#ifndef _TASK_H_
#define _TASK_H_

#include "request.h"
#include "response.h"
#include "memory"
#include "singleton.h"
#include "epollE.h"
#include "socketE.h"
#include "string"
#include "vector"
#include "classObject.h"
#include "classRegister.h"
#include "classFactory.h"
#include "fileSystem.h"
#include "Json.h"
#include "singleton.h"
#include "Logger.h"

#include <boost/algorithm/string.hpp>

namespace easyWebServer
{

class Task
{
public:
    enum Statue
    {
        TASK_IN = 0,
        TASK_OUT,
    };

public:
    Task() = delete;
    Task(int fd);
    ~Task();

    void run();
    void setStatue(Statue statue);
    int getFd();
    Statue getStatue();

private:
    void taskIn();
    void taskOut();
    bool parseUrl(const string & url, string & idx1, string & idx2, string & paramter);



private:
    int m_fd = -1;
    shared_ptr<Request> m_request;
    shared_ptr<Response> m_response;
    shared_ptr<FileSystem> m_fileSystem;
    Statue m_statue = TASK_IN;

};


}


#endif